Skip to content

Expose configurable routing scorer parameters#889

Open
pwltr wants to merge 2 commits intolightningdevkit:mainfrom
pwltr:feat/scorer-params
Open

Expose configurable routing scorer parameters#889
pwltr wants to merge 2 commits intolightningdevkit:mainfrom
pwltr:feat/scorer-params

Conversation

@pwltr
Copy link
Copy Markdown

@pwltr pwltr commented Apr 24, 2026

Summary

Adds configurable pathfinding scorer parameters so apps can tune routing behavior instead of always using LDK defaults.

It introduces two new config surfaces:

  • ScoringFeeParameters (maps to ProbabilisticScoringFeeParameters)
  • ScoringDecayParameters (maps to ProbabilisticScoringDecayParameters)

These can now be set through:

  • Config (scoring_fee_params, scoring_decay_params)
  • Builder APIs:
    • set_scoring_fee_params(...)
    • set_scoring_decay_params(...)

At build time, ldk-node now uses configured scorer params when constructing a new ProbabilisticScorer (when no persisted scorer exists) and router fee params, falling back to LDK defaults when unset.

Changes and PR description created with agentic assistance

@ldk-reviews-bot
Copy link
Copy Markdown

ldk-reviews-bot commented Apr 24, 2026

I've assigned @tnull as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@ldk-reviews-bot ldk-reviews-bot requested a review from tnull April 24, 2026 15:37
@ldk-reviews-bot
Copy link
Copy Markdown

🔔 1st Reminder

Hey @tnull! This PR has been waiting for your review.
Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

Copy link
Copy Markdown
Collaborator

@tnull tnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, so far we intentionally were holding back exposing all of these fields, as many are pretty cryptic to most users. Rather it would be preferable if we could provide sane defaults.

Could you expand on what you're actually looking to change? Also note that some of these changes might conflict/be impacted by the work over at #815.

@pwltr
Copy link
Copy Markdown
Author

pwltr commented Apr 27, 2026

Could you expand on what you're actually looking to change?

Yeah so we are in the situation that we are seeing really bad payment/probing success rate at the moment and relying on a good set of scores from a remote prober alone does not resolve the issue. From testing it seems to be necessary to also tune scoring params on the client itself, predominately bumping base_penalty_msat and base_penalty_amount_multiplier_msat showed immediate improvement.

If we can find good defaults that would be preferable. For now we are grossly increasing basePenaltyMsat to default * 500 and basePenaltyAmountMultiplierMsat to default * 3, maybe unnecessarily high, but defaults really didn't give good results for any medium to large amounts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants